import Vue from 'vue';
import Router from 'vue-router'
import Index from '../view/index.vue';
import news from '../view/news.vue'
import sport from '../view/sport.vue'
import tindex from '../view/child/tindex.vue'
import china from '../view/child/china.vue'
import abroad from '../view/child/abroad.vue'
Vue.use(Router)
const router = [
    {
        path: '/',
        redirect: "/index"
    },
    {
        path: '/index',
        component: Index,
        
    },
    {
        path: '/news',
        component:news
    },
    {
        path: '/sport',
        component: sport,
        children: [
            {
              path: "tindex",
              component: tindex
            },
            {
              path: "china",
              component: china
            },
            {
              path: "abroad",
              component: abroad
            }
      ]
    },
]
const routes = new Router({ 
    routes:router   //上边的
})
export default routes